package test;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import expression.PostfixEvaluator;


public class WilliamFoleyPETest {
	
	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void test() {
		
		int answer = PostfixEvaluator.eval("3 6 *");
		assertTrue(answer == 18);
	}
	
	@Test
	public void test2() {
		
		int answer2 = PostfixEvaluator.eval("2 4 +");
		assertTrue(answer2 == 6);
	}
	
	@Test
	public void test3() {
		
		int answer3 = PostfixEvaluator.eval("2 4 -");
		assertTrue(answer3 == -2);	
	}
	
	@Test
	public void test4() {
		
		int answer4 = PostfixEvaluator.eval("8 4 /");
		assertTrue(answer4 == 2);
	}
	
	@Test
	public void test5() {
		
		int answer5 = PostfixEvaluator.eval("3 5 2 * +");
		assertTrue(answer5 == 13);
	}
	
	@Test
	public void test6() {
		
		int answer6 = PostfixEvaluator.eval("5 3 * 5 +");
		assertTrue(answer6 == 20);
	}
	
	@Test
	public void test7() {
		
		int answer7 = PostfixEvaluator.eval("4 4 2 ^ + 5 /");
		assertTrue(answer7 == 4);
	}
}
